const Koa = require('koa');
const Router = require('koa-router');
const bodyParser = require('koa-bodyparser');

const app = new Koa();
const router = new Router();

app.use(bodyParser());

router.post('/process', (ctx) => {
    console.log(ctx);

  ctx.body = { ...ctx.request.body, type: 1 };
});

app.use(router.routes()).use(router.allowedMethods());

app.listen(3001, () => {
  console.log('Server 2 is running on http://localhost:3001');
});
